<div class="options">
  <a
    mat-raised-button
    href="https://github.com/tiberiuzuld/angular-gridster2/tree/master/src/app/sections/gridTypes"
    target="_blank"
    class="source-code-button"
  >
    <mat-icon>open_in_new</mat-icon>
    Source
  </a>
  <markdown [src]="'assets/gridTypes.md'"></markdown>
</div>
<div class="options-header">
  <mat-form-field>
    <mat-label>Grid Type</mat-label>
    <mat-select aria-label="Grid type" [(ngModel)]="options.gridType" (ngModelChange)="changedOptions()">
      <mat-option value="fit">Fit to screen</mat-option>
      <mat-option value="scrollVertical">Scroll Vertical</mat-option>
      <mat-option value="scrollHorizontal">Scroll Horizontal</mat-option>
      <mat-option value="fixed">Fixed</mat-option>
      <mat-option value="verticalFixed">Vertical Fixed</mat-option>
      <mat-option value="horizontalFixed">Horizontal Fixed</mat-option>
    </mat-select>
  </mat-form-field>
  <mat-form-field>
    <mat-label>Fixed Col Width</mat-label>
    <input matInput [(ngModel)]="options.fixedColWidth" (ngModelChange)="changedOptions()" type="number" />
  </mat-form-field>
  <mat-form-field>
    <mat-label>Fixed Row Height</mat-label>
    <input matInput [(ngModel)]="options.fixedRowHeight" (ngModelChange)="changedOptions()" type="number" />
  </mat-form-field>
  <mat-form-field>
    <mat-label>Row Height Ratio</mat-label>
    <input [(ngModel)]="options.rowHeightRatio" (ngModelChange)="changedOptions()" matInput step="0.1" type="number" />
  </mat-form-field>
  <mat-checkbox [(ngModel)]="options.setGridSize" (ngModelChange)="changedOptions()"> Set Grid Size </mat-checkbox>
  <mat-checkbox [(ngModel)]="options.keepFixedHeightInMobile" (ngModelChange)="changedOptions()"> Keep Fixed Height In Mobile </mat-checkbox>
  <mat-checkbox [(ngModel)]="options.keepFixedWidthInMobile" (ngModelChange)="changedOptions()"> Keep Fixed Width In Mobile </mat-checkbox>
  <mat-checkbox [(ngModel)]="options.useBodyForBreakpoint" (ngModelChange)="changedOptions()"> Use Body Width as Breakpoint </mat-checkbox>
  <mat-form-field>
    <mat-label>Mobile Breakpoint</mat-label>
    <input matInput [(ngModel)]="options.mobileBreakpoint" (ngModelChange)="changedOptions()" type="number" />
  </mat-form-field>
  <button mat-mini-fab (click)="addItem()" class="add-button cols-2">
    <mat-icon>add</mat-icon>
  </button>
</div>

<gridster [options]="options">
  @for (item of dashboard; track item.id) {
    <gridster-item [item]="item">
      <div class="button-holder">
        <button mat-mini-fab (mousedown)="removeItem($event, item)" (touchstart)="removeItem($event, item)">
          <mat-icon>delete</mat-icon>
        </button>
      </div>
    </gridster-item>
  }
</gridster>
